<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:cc="http://java.sun.com/jsf/composite"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	>
<cc:interface>

	<cc:attribute name="urlPopUp" required="true" type="String" />
	<cc:attribute name="popUpName" required="true" type="String" />
	<cc:attribute name="manageBean" required="true" />
	<cc:attribute name="ouvinteRendered" required="false" type="String" />
	<cc:attribute name="title" required="false"  type="String" default="Listagem" />
	<cc:attribute name="width" required="false"   type="int" default="400" />
	<cc:attribute name="height" required="false"   type="int" default="350" />
	<cc:attribute name="message" required="false"   type="String"  />
</cc:interface>
<cc:implementation>
	<ui:fragment rendered="#{cc.attrs.manageBean.manager!=null}">

		<ui:fragment
			rendered="#{cc.attrs.id==cc.attrs.manageBean.manager.componente}">
			
			<ui:fragment rendered="#{cc.attrs.manageBean.manager.showComponente}">
				<p:confirmDialog message="#{cc.attrs.message}"  header="#{cc.attrs.title}" widgetVar="#{cc.attrs.popUpName}"
					modal="true" height="#{cc.attrs.height}" width="#{cc.attrs.width}"  severity="alert" >
					<ui:include src="../#{cc.attrs.urlPopUp}">
								<ui:param name="ouvinteRendered" value="#{cc.attrs.ouvinteRendered}" />
								<ui:param name="popUpName" value="#{cc.attrs.popUpName}" />
								<ui:param name="idComponente" value="#{cc.attrs.id}" />
					</ui:include>
				</p:confirmDialog>
				<ui:fragment rendered="#{cc.attrs.manageBean.showPopUp}">
					<script>
						#{cc.attrs.popUpName}.show()
					</script>
				</ui:fragment>
			</ui:fragment>
		</ui:fragment>
	</ui:fragment>
</cc:implementation>

</html>
